package main

import (
	//"strconv"
	"fmt"
	"strconv"
	"sort"
)

type Element interface {

}

type List []Element

type Person struct {
	name string
	age int
}

func (p Person) String() string {
	return "(name: " + p.name + " - age: " + strconv.Itoa(p.age) + " years)"
}


type Interface interface {
	sort.Interface
}

func main() {
	var ii Interface
	
	fmt.Println(ii)
	
	
	//p := Person{"glxe", 28}
	
	//fmt.Println(p.String())
	
	l := make(List, 3)
	
	l[0] = 1
	l[1] = "Hello"
	l[2] = Person{"Dennis", 70}
	
	for index, e := range l {
		
		fmt.Printf("e is %v\n", e)
		
		if value, ok := e.(int); ok {
			fmt.Printf("if list[%d] is an int and its value is %d\n", index, value)
		}else if value, ok := e.(string); ok {
			fmt.Printf("if list[%d] is an string and its value is %s\n", index, value)
		}else if value, ok := e.(Person); ok {
			fmt.Printf("if list[%d] is an person and its value is %v\n", index, value)
		}
		
		switch value := e.(type) {
		case int:
			fmt.Printf("switch list[%d] is an int and its value is %d\n", index, value)
		case string:
			fmt.Printf("switch list[%d] is an string and its value is %s\n", index, value)
		case Person:
			fmt.Printf("switch list[%d] is an person and its value is %v\n", index, value)
		}
	}
	
	
	
}